<template>
	<view class="page">
		<view class="search-types-box">
			<view class="input-view">
				<uni-icon type="search" size="22" color="#666666" />
				<input confirm-type="search" class="input" type="text" placeholder="输入搜索关键词" @confirm="confirm" />
			</view>
			<text class="titles">-常用分类-</text>
			<view class="types-box">
				<navigator v-for="(item,index) in types" :key="index" class="types-item" :url="item.url">
					<view :style="{'background-color':item.bgColor}">
						<image :src="item.icon"></image>
					</view>
					<view>{{item.title}}</view>
				</navigator>
			</view>
		</view>
		<view class="brand-box">
			<text class="titles">-精选品牌-</text>
			<view class="types-box">
				<view v-for="(item,index) in brands" :key="index" class="types-item">
					<view>
						<image :src="item.icon"></image>
					</view>
					<view>{{item.title}}</view>
				</view>
			</view>
		</view>
		<view class="goods-box">
			<text class="titles">-热销药品-</text>
			<view class="good-item" v-for="(item,index) in goods" :key="index">
				<image :src="item.image" class="good-item-image"></image>
				<view class="good-item-info">
					<text>{{item.title}}</text>
					<text>规格:{{item.sizeText}}</text>
					<text>￥{{item.price}}</text>
				</view>
				<image src="http://yao.hayzon.com/static/buyMedicine/cart.png" class="cart"></image>
			</view>
		</view>
		
		<view class="bottom-button">需求清单</view>
	</view>
</template>
<style>
	.page {}

	.titles {
		font-size: 1.2em;
		color: #333333;
		display: block;
		text-align: center;
		letter-spacing: 8upx;
	}

	.search-types-box,
	.brand-box,
	.goods-box {
		margin-top: 10upx;
		background-color: #ffffff;
		padding: 30upx;
		padding-top: 15upx;
	}
	.goods-box{
	}
	.good-item {
		position: relative;
		display: flex;
		border-bottom:2px solid #f4f5f6;
		margin-top:5upx;
	}

	.cart {
		width: 60upx;
		height: 60upx;
		position: absolute;
		right: 30upx;
		bottom: 10upx;
	}

	.good-item-info {
		padding-left: 25upx;
		flex: 2;
	}

	.good-item-info text {
		display: block;
	}

	.good-item-info text:first-child {
		font-size: 1.1em;
		color: #333333;
		font-weight: bold;
	}

	.good-item-info text:nth-child(2) {
		font-size: 0.9em;
		color: #999999;
	}

	.good-item-info text:last-child {
		margin-top: 35upx;
		font-size: 1.2em;
		color: #e1894d;
		font-weight: bold;
	}

	.good-item-image {
		width: 200upx;
		height: 200upx;
		flex-shrink: 0;
	}
	.bottom-button{
		position:fixed;
		bottom:0;
		width:100%;
		background-color:#e15f4d;
		color:#ffffff;
		font-size:1.5em;
		font-weight: bold;
		line-height:120upx;
		text-align: center;
		letter-spacing: 8upx;
	}
	.types-box {
		display: flex;
		flex-direction: row;
		flex-wrap: wrap;
	}

	.types-item {
		width: 25%;
		text-align: center;
		margin-top: 20upx;
		color: #333333;
		font-size: 1.1em;
		font-weight: bold;
	}

	.types-item view:first-child {
		margin: 0 auto;
		width: 100upx;
		border-radius: 60upx;
		padding-top: 20upx;
	}

	.types-item image {
		width: 60upx;
		height: 60upx;
	}

	.input-view {
		display: flex;
		background-color: #e7e7e7;
		height: 30px;
		border-radius: 15px;
		padding: 0 4%;
		flex-wrap: nowrap;
		margin: 10upx 10upx;
		line-height: 30px;
	}

	.input-view .uni-icon {
		line-height: 30px !important;
	}

	.input-view .input {
		height: 30px;
		line-height: 30px;
		width: 94%;
		padding: 0 3%;
	}
</style>
<script>
	import uniIcon from '@/components/uni-icon/uni-icon.vue'
	export default {
		components: {
			uniIcon
		},
		data() {
			return {
				types: [{
						icon: "http://yao.hayzon.com/static/buyMedicine/01.png",
						title: "热销",
						bgColor: "#ffce56"
					},
					{
						icon: "http://yao.hayzon.com/static/buyMedicine/02.png",
						title: "感冒发烧",
						bgColor: "#61e8be"
					},
					{
						icon: "http://yao.hayzon.com/static/buyMedicine/03.png",
						title: "肠胃",
						bgColor: "#dfe832"
					},
					{
						icon: "http://yao.hayzon.com/static/buyMedicine/04.png",
						title: "男科",
						bgColor: "#7cbdf2"
					},
					{
						icon: "http://yao.hayzon.com/static/buyMedicine/05.png",
						title: "妇科",
						bgColor: "#f9a5d4"
					},
					{
						icon: "http://yao.hayzon.com/static/buyMedicine/06.png",
						title: "儿科",
						bgColor: "#61e8be"
					},
					{
						icon: "http://yao.hayzon.com/static/buyMedicine/07.png",
						title: "拍方抓药",
						bgColor: "#e46a6a"
					},
					{
						icon: "http://yao.hayzon.com/static/buyMedicine/08.png",
						title: "自诊购药",
						bgColor: "#ffce56",
						url:'model'
					}
				],
				brands: [{
						icon: "http://yao.hayzon.com/static/buyMedicine/icon1.png",
						title: "同仁堂"
					},
					{
						icon: "http://yao.hayzon.com/static/buyMedicine/icon2.png",
						title: "仲景"
					},
					{
						icon: "http://yao.hayzon.com/static/buyMedicine/icon3.png",
						title: "九芝堂"
					},
					{
						icon: "http://yao.hayzon.com/static/buyMedicine/icon4.png",
						title: "东阿阿胶"
					},
					{
						icon: "http://yao.hayzon.com/static/buyMedicine/icon5.png",
						title: "仁和"
					},
					{
						icon: "http://yao.hayzon.com/static/buyMedicine/icon6.png",
						title: "天士力"
					},
					{
						icon: "http://yao.hayzon.com/static/buyMedicine/icon7.png",
						title: "云南白药"
					},
					{
						icon: "http://yao.hayzon.com/static/buyMedicine/icon8.png",
						title: "片仔癀"
					}
				],
				goods: [{
						title: " 九芝堂六味地黄丸60g水...",
						sizeText: " 60g水蜜丸",
						price: "12.3",
						image: "http://yao.hayzon.com/static/buyMedicine/item_1.png"
					},
					{
						title: " 同仁堂六味地黄丸300s...",
						sizeText: " 300s浓缩丸",
						price: " 45 ",
						image: "http://yao.hayzon.com/static/buyMedicine/item_2.png"
					},
					{
						title: " 咨询立减)同溢堂益安宁...",
						sizeText: " 112s*3瓶 浓缩水蜜丸",
						price: "790",
						image: "http://yao.hayzon.com/static/buyMedicine/item_3.png"
					},
					{
						title: " 钙尔奇碳酸钙D3片(钙尔...",
						sizeText: " 0.6g*60s薄膜衣 ",
						price: "66",
						image: "http://yao.hayzon.com/static/buyMedicine/item_4.png"
					},
					{
						title: " 同仁堂六味地黄丸200粒",
						sizeText: " 200粒浓缩丸 ",
						price: "25",
						image: "http://yao.hayzon.com/static/buyMedicine/item_1.png"
					},
					{
						title: " 亮甲复方聚维酮碘搽剂",
						sizeText: " 3ml*2瓶 ",
						price: "78",
						image: "http://yao.hayzon.com/static/buyMedicine/item_2.png"
					},
					{
						title: " 京都念慈奄蜜炼川贝枇杷...",
						sizeText: " 150ml",
						price: " 33.8 ",
						image: "http://yao.hayzon.com/static/buyMedicine/item_3.png"
					},
					{
						title: " 敖东安神补脑液10ml*10支ehaovaoke",
						sizeText: " 10ml*10支",
						price: " 23",
						image: "http://yao.hayzon.com/static/buyMedicine/item_4.png"
					},
					{
						title: " 同仁堂五子衍宗丸60g水...",
						sizeText: " 60g 水蜜丸",
						price: " 21",
						image: "http://yao.hayzon.com/static/buyMedicine/item_1.png"
					}
				]
			}
		}
	}
</script>
